Force building with c++17 standard
authorBoyuan Yang <byang@debian.org>
Tue, 9 Sep 2025 12:26:44 +0000 (08:26 -0400)
committerBoyuan Yang <byang@debian.org>
Tue, 9 Sep 2025 12:26:44 +0000 (08:26 -0400)
debian/changelog
debian/patches/0002-Force-build-with-c-17.patch [new file with mode: 0644]
debian/patches/series

index 18981b51a84d8cf5eb2d6c8c2ab88e2ea1142b82..842727c047847fde17da368ebad561f32448c8ea 100644 (file)
@@ -3,8 +3,10 @@ opencc (1.1.9+ds1-2) unstable; urgency=medium
   * debian/patches/backport/0006-Fix-build-for-gcc-15-934.patch,
     debian/patches/backport/0007-Fix-deprecated-declarations-in-C-17.patch:
     Backport upstream patches to fix FTBFS with GCC 15. (Closes: #1097512)
+  * debian/patches/0002-Force-build-with-c-17.patch: Force building with
+    c++17 standard to fix FTBFS with the new googletest.
 
- -- Boyuan Yang <byang@debian.org>  Tue, 09 Sep 2025 08:20:41 -0400
+ -- Boyuan Yang <byang@debian.org>  Tue, 09 Sep 2025 08:26:01 -0400
 
 opencc (1.1.9+ds1-1) unstable; urgency=medium
 
diff --git a/debian/patches/0002-Force-build-with-c-17.patch b/debian/patches/0002-Force-build-with-c-17.patch
new file mode 100644 (file)
index 0000000..b06452f
--- /dev/null
@@ -0,0 +1,31 @@
+From: Boyuan Yang <byang@debian.org>
+Date: Tue, 9 Sep 2025 08:25:14 -0400
+Subject: Force build with c++17
+
+Needed by googletest.
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ba28233..25abb7d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -155,7 +155,7 @@ add_definitions(
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+   add_definitions(
+-    -std=c++14
++    -std=c++17
+     -Wall
+   )
+   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
+@@ -164,7 +164,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+   endif ()
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+   add_definitions(
+-    -std=c++14
++    -std=c++17
+     -Wall
+   )
+   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
index eb0994ee1064ed08d57c4baab21d75f78e47b3dd..51792024ba4aaad152ae1a5098d7fa64812ea1f0 100644 (file)
@@ -1,4 +1,5 @@
 0001-use-cmake-install-libdir.patch
+0002-Force-build-with-c-17.patch
 0003-no-remote-images-when-reading-docs-on-disk.patch
 0004-Use-system-googletest.patch
 0005-Disable-build-in-setup.py.patch